package com.ts.api.manage.media;

import com.ts.framework.domain.media.response.CheckChunkResult;
import com.ts.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.multipart.MultipartFile;

@Api(value = "媒资上传管理接口", description = "负责文件分块、文件上传、文件合并等功能")
public interface MediaUploadControllerApi {
    @ApiOperation("文件上传注册")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "文件MD5信息", name = "fileMd5", paramType = "path", dataType = "String", required = true)
    })
    public ResponseResult register(String fileMd5,
                                   String fileName,
                                   Long fileSize,
                                   String mimetype,
                                   String fileExt);

    @ApiOperation("分块检查")
    public CheckChunkResult checkchunk(String fileMd5,
                                       Integer chunk,
                                       Integer chunkSize);

    @ApiOperation("上传分块")
    public ResponseResult uploadchunk(MultipartFile file,
                                      Integer chunk,
                                      String fileMd5);

    @ApiOperation("合并文件")
    public ResponseResult mergechunks(String fileMd5,
                                      String fileName,
                                      Long fileSize,
                                      String mimetype,
                                      String fileExt);
}
